<template>
  <div class="singerpage">
    <!-- 导航栏 -->
    <div class="title">
      <span
        class="iconfont icon-fanhui"
        @click="$router.push('/home/index')"
      ></span>
      <span class="iconfont icon-gengduo"></span>
    </div>
    <!-- 个人名片 -->
    <div class="userinfo" v-if="singerdetail">
      <div class="infot">
        <img :src="singerdetail?.cover" alt="" />
        <span>{{ singerdetail.name }}</span>
      </div>
      <div class="infob">
        <div class="left">
          <span
            >关注 <span class="num"> {{ singerdetail.musicSize }}万</span></span
          >
          <span
            >粉丝 <span class="num"> {{ singerdetail.mvSize }}万</span></span
          >
        </div>
        <div class="guanzhu">
          <span>关注</span>
        </div>
      </div>
    </div>
    <!-- 个人内容 -->
    <div class="content">
      <div class="navicat">
        <router-link
          :to="`/singer/main?id=${$route.query.id}`"
          :singerdetail="singerdetail"
          >主页</router-link
        >
        <router-link
          :to="`/singer/work?id=${$route.query.id}`"
          :singersongs="singersongs"
          >作品</router-link
        >
      </div>
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
import { get } from "@/http/request.js";
export default {
  data() {
    return {
      singerdetail: null,
      singersongs: null,
    };
  },
  mounted() {
    console.log();
    // 获取歌手详情

    get(`/artist/detail?id=${this.$route.query.id}`).then((res) => {
      console.log(res.data.data.artist);
      this.singerdetail = res.data.data.artist;
    });
    // 获取歌手单曲

    get(`/artist/detail?id=${this.$route.query.id}`).then((res) => {
      console.log(res);
    });
  },
};
</script>

<style lang="scss" scoped>
@import url(../comman/css/singerview.css);
</style>
